<template>
	<view >
		<view class="main   p30 ">
			<p class="title">请填写店铺简介（最多200个字符）</p>	
			<view class="txt bgw">
				<textarea v-model="txt"  class="text-sm" maxlength="200" placeholder="请填写店铺简介" />
				<p  @tap="txt = '' ">全部清空</p>
			</view>
		</view>
		<view class="btn p30">
			<button @tap="send()" class="text-lg br42 btnbg">确认修改</button>
		</view>		
	</view>
</template>

<script>
	import {updateStoreInfo} from '@/api/api.js'
	export default {
		data() {
			return { 
				shakeState:0,
				txt:''
			}
		},
		methods: {
			async send(){
				if(this.txt.size>0){
					uni.showToast({
						title:'经营范围不能为空',
						icon:'none'
					})
				}else{
					let data = { 
						"description": this.txt
					}
					if(this.shakeState == 0){
						this.shakeState = 1
						let state = await updateStoreInfo(data)
						if(state.code == 0){
							setTimeout(()=>{
								uni.navigateBack()
							},1000)
						}		
					}else{
						this.shakeState = 0
					}
					
				}
			}
		}
	}
</script>

<style lang="less" scoped>
@import './index.less';
</style>
